const http = require('http');

let server = http.createServer((req, res) => {
  console.log('有人访问了');
  //request     请求  接收的数据(输入)
  //response    响应  发送的数据(输出)
  console.log(req.method);
  console.log(req.url);

  switch (req.url) {
    case '/aaa.html':
      res.write('hello aaa')
      break;

    default:
      break;
  }


  res.end()
})
//监听

server.listen(1000)